# Contributor: Assaf Inbal <shmuelzon@gmail.com>
# Maintainer: Saijin-Naib <Saijin-Naib_package-maintenance@outlook.com>
pkgname=onevpl-intel-gpu
pkgver=23.2.4
pkgrel=1
pkgdesc="Intel oneVPL GPU Runtime"
options="!check" # tests can't run in check(), only on install
url="https://github.com/oneapi-src/oneVPL-intel-gpu"
arch="x86_64"
license="MIT"
depends="libva"
makedepends="
	cmake
	libva-dev
	samurai
	"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/oneapi-src/oneVPL-intel-gpu/archive/refs/tags/intel-onevpl-$pkgver.tar.gz"
builddir="$srcdir/oneVPL-intel-gpu-intel-onevpl-$pkgver"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja -Wno-dev \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		$CMAKE_CROSSOPTS
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
4edadb45eac2246f15301f08ad90af5695b1d848391a639447ff292ec9df85d64ea9bd04cfb52fdb751ed3707601515b09988cebcbd06b03411cb2d69970512d  onevpl-intel-gpu-23.2.4.tar.gz
"
